import { http } from "@/utils/http";

// 提现列表请求参数
export interface WithdrawListRequest {
  page: number;
  pageSize: number;
  keyword?: string;
  status?: number;
  start_time?: string;
  end_time?: string;
}

// 提现信息
export interface Withdraw {
  id: number;
  user_id: number;
  username: string;
  amount: number;
  fee: number;
  actual_amount: number;
  bank_name: string;
  bank_card: string;
  bank_address: string;
  status: number;
  remark: string;
  created_at: string;
  updated_at: string;
}

// 获取提现列表
export const getWithdrawList = (data: WithdrawListRequest) => {
  return http.request<{
    code: number;
    msg: string;
    data: {
      list: Withdraw[];
      total: number;
    };
  }>("post", "/partner/withdraws", { data });
};

// 审核提现
export const auditWithdraw = (data: { id: number; status: number; remark?: string }) => {
  return http.request<{
    code: number;
    msg: string;
  }>("post", "/partner/withdraw/audit", { data });
}; 